package org.example.medical.Mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.medical.entity.DiagnosisRecord;

import java.util.List;

@Mapper
public interface DiagnosisRecordMapper {
    // 查询诊断记录分页数据（按患者姓名和疾病名称）
    List<DiagnosisRecord> selectByPageAndFilters(
            @Param("patientName") String patientName,
            @Param("diseaseName") String diseaseName,
            @Param("status") String status,
            @Param("diagnosisTime") String diagnosisTime,
            @Param("offset") int offset,
            @Param("size") int size
    );

    // 新增诊断记录
    void insertDiagnosisRecord(DiagnosisRecord diagnosisRecord);

    // 更新诊断记录
    void updateDiagnosisRecord(DiagnosisRecord diagnosisRecord);

    // 软删除诊断记录
    void softDeleteDiagnosisRecord(@Param("diagnosisId") Long diagnosisId);

    // 批量软删除诊断记录
    void batchSoftDeleteDiagnosisRecords(@Param("diagnosisIds") List<Long> diagnosisIds);

    List<Long> getDiagnosisIdsByPatientId(int patientId);
    List<Long> getDiagnosisIdsByDiseaseId(int diseaseId);

}